﻿using System;
using System.Collections.Generic;
using System.Windows.Forms;

namespace DevelopTool.Model
{
    /// <summary>
    /// 系统菜单实体
    /// </summary>
    public class SystemMenuModel
    {
        /// <summary>
        /// 菜单文本
        /// </summary>
        public string Text { get; set; }

        /// <summary>
        /// 图标
        /// </summary>
        public int Symbol { get; set; } = 0;

        /// <summary>
        /// 图标尺寸
        /// </summary>
        public int SymbolSize { get; set; } = 24;

        /// <summary>
        /// 关联显示的窗口
        /// </summary>
        public Type FormType { get; set; }

        /// <summary>
        /// 窗体对象（实例化后的）
        /// </summary>
        public Form Form { get; set; }

        /// <summary>
        /// 窗口显示方式
        /// </summary>
        public FormShowType FormShowType { get; set; } = FormShowType.Page;

        /// <summary>
        /// 页索引
        /// </summary>
        public Guid PageIndex { get; set; } = Guid.NewGuid();

        /// <summary>
        /// 子菜单
        /// </summary>
        public List<SystemMenuModel> ChildMenus { get; set; } = new List<SystemMenuModel>();

        /// <summary>
        /// 是否允许窗口多开，默认不允许
        /// </summary>
        public bool AllowMultipleOpen { get; set; } = false;

        /// <summary>
        /// 程序名称
        /// </summary>
        public string ProcessFileName { get; set; }

        /// <summary>
        /// 是否在操作手册中显示
        /// </summary>
        public bool IsShowToOperTutorial { get; set; } = true;

        /// <summary>
        /// 是否在系统菜单显示
        /// </summary>
        public bool IsShowToSysMenu { get; set; } = true;

        /// <summary>
        /// 是否在关闭前确认
        /// </summary>
        public bool IsCloseConfirm { get; set; } = true;
    }

    /// <summary>
    /// 窗口显示方式
    /// </summary>
    public enum FormShowType
    {
        /// <summary>
        /// page页
        /// </summary>
        Page = 1,

        /// <summary>
        /// 弹窗显示ShowDialog
        /// </summary>
        ShowDialog = 2,

        /// <summary>
        /// 弹窗显示Show
        /// </summary>
        Show = 3,

        /// <summary>
        /// 独立（外部）程序exe
        /// </summary>
        ExternalEXE = 4,

        /// <summary>
        /// 自定义
        /// </summary>
        Custom = 5,

        /// <summary>
        /// 插件
        /// </summary>
        Plugins = 6
    }
}

